class Cache {
  setitem(name: string, info: any) {
    localStorage.setItem(name, JSON.stringify(info))
  }

  getitem(name: string) {
    return JSON.parse(localStorage.getItem(name) || '[]')
  }

  clearitem(name: string) {
    localStorage.removeItem(name)
  }

  clearall() {
    localStorage.clear()
  }
}

export const LocalCache = new Cache()
